package com.own.business.exam.entity.dto;


import com.own.business.exam.entity.bo.ExamRulePaperBo;
import com.own.component.common.base.entity.BaseDto;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * ExamRulePaperDto
 *
 * @author chenxueli
 * @date 2021/05/18 14:43:47
 */
@Schema(title = "考试规则指定试卷表" + ConstantBeanSuffix.DTO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamRulePaperDto extends BaseDto<ExamRulePaperBo> {

    @Schema(title = "规则id")
    private Long ruleId;

    @Schema(title = "账号名称")
    private String title;

    /**
     * 转业务层对象
     *
     * @param entity 原业务层对象
     * @return 业务层对象
     */
    @Override
    public ExamRulePaperBo toBo(ExamRulePaperBo entity) {
        if (entity == null) {
            entity = new ExamRulePaperBo();
        }
        entity.setRuleId(ruleId);
        entity.setTitle(title);
        return super.toBo(entity);
    }

}
